# encoding=utf-8
import sys
sys.path.append('search/modules/aima')
sys.path.append('search/modules/tree')
sys.path.append('search/maps')
sys.path.append('search/algorithms')
sys.path.append('utils')
sys.path.append('gui')
sys.path.append('pygraph')

# SEARCH
from search import GraphProblem
from map_australia import australia
from bfs import BFS
from dfs import DFS
# GUI
from window import vp_start_gui

class App:

	def __init__(self, problem, model):
		self._problem = problem
		self._model = model

	def gui(self):
		vp_start_gui()

	def bfs(self):
		bfs = BFS(self._problem, model=self._model)
		return bfs.execute()

	def dfs(self):
		dfs = DFS(self._problem, model=self._model)
		return dfs.execute()

app = App(GraphProblem('ADELAIDE', 'KATHERINE', australia), 'tree')
resultado = app.bfs()
solution = resultado[0].solution()
# tree=resultado[1]
# tree.show()
print 'Solução:', solution
# tests
app.gui()
# print app.bfs()
